import request from '@/utils/request'

//获取一级分类
export async function getProduct() {
  return await request({
    url: "/type"
  })

}
//创建一级分类
export async function addProduct(product) {
  return await request({
    url: "/type/add",
    method: "post",
    data: product
  });
}

//删除一级分类
export async function delProduct(product) {
  console.log(product);
    return await request({
        url: `/type/del/${product._id}`,
        method: "delete",
    })
}

//查询一级分类
export async function chaProduct() {

}

//修改一级分类
export async function xiuProduct(product) {
    console.log(product);
    return await request({
        url: `/type/eit/${product._id}`,
        method: "put",
        data: product
    })

}
